home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
GRAPHSYS.ARJ
/
DEMOSYS.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-02-26
|
3KB
|
91 lines
{
G R /\ P ├┤ S Y S VER 1.00
IF YOU USE THIS PROGRAM SEND $5.00 TO:
37 BEARPAW #37B
IRVINE, CA. 92714
UNITED STATES
THIS UNIT ALLOWS YOU TO LOAD IMAGES CONVERTED BY CONVERT.EXE. CONVERT.EXE
CONVERTS BSAVE IMAGE FILES TO A FILE FORMAT MUCH FASTER TO LOAD. PICTOR,
INCLUDED IN GRASP, WILL SAVE IN BSAVE FORMAT. ANY FILE FORMAT THAT HAS
THIS STRUCTURE WILL WORK:
1-7: BYTE: GAP, HEADER, OR X-Y LOCATION;
8-64007: BYTE(S): PIXEL COLOR(S);
THE PALETTE FILE STRUCTURE:
1-255
RED: BYTE
GREEN: BYTE
BLUE: BYTE
CONVERT ONLY SAVES 0,0 TO 318, 198 BECAUSE OF THE MEMORY CONSTRAINTS.
BY REGISTERING, YOU WILL GET THE ANNOYING 12 SECOND MESSAGE
ELEMINATED WHEN THE UNIT IS LOADED. IF YOU HAVE ANY COMMENTS,
QUESTIONS, OR WISH TO REGISTER, PLEASE WRITE TO THE ADDRESS ABOVE.
COMMANDS:
KILLMEM - MUST CALL AT THE END OF THE PROGRAM
TO DESTROY THE MEMORY POINTER!
DISPLAYIMG(FILENAME) - USED TO DISPLAY IMAGE
LOADIMG(FILENAME) - MUST CALL BEFORE DISPLAYING THE IMAGE!
LOADPAL(FILENAME) - USED TO ADJUST THE CURRENT PALETTE TO
MATCH THE IMAGE'S PALETTE
* SAVEIMG(FILENAME) - SAVES A IMAGE IN THE QUICK FILE FORMAT
* = DISABLED IN UNREGISTERED VERSION
P . C . S O F T \/\/ /\ R ≡ }
{----------------------------------------------------------------------------}
{MAIN CODE}
{----------------------------------------------------------------------------}
{$M 4000,0,655360} {WHAT EVER WORKS BEST}
USES GRAPHSYS, GRAPH,CRT;
VAR
DRIVER, MODE, TESTDRIVER,
ERRCODE : INTEGER;
{$F+}
FUNCTION TESTDETECT : INTEGER;
BEGIN
TESTDETECT := 1;
END;
{$F-}
BEGIN {BASIC CODE TO INIT GRAPHICS}
TESTDRIVER := {DRIVER NOT INCLUDED WITH TP}
INSTALLUSERDRIVER('VGA256', @TESTDETECT);
IF GRAPHRESULT <> GROK THEN
BEGIN
WRITELN('ERROR INSTALLING GRAPHICS DRIVER');
HALT(1);
END;
DRIVER := DETECT;
INITGRAPH(DRIVER, MODE, '');
ERRCODE := GRAPHRESULT;
IF ERRCODE <> GROK THEN
BEGIN
WRITELN('ERROR DURING INIT: ', ERRCODE);
HALT(1);
END;
BEGIN
LOADIMG('DEMO.IMG'); {<-LOADS IMAGES CREATED WITH CONVERT.EXE
IMAGE MUST BE A BSAVE IMAGE ORIGINALLY OR A PIXEL BY
PIXEL LIST IN A FILE.}
DISPLAYIMG; {<-DISPLAYS IMAGE AT 0,0 WITH CURRENT PALETTE}
LOADPAL('DEMO.PAL'); {<-THIS ADJUSTS THE PALETTE TO MATCH THE PICTURE}
{ FILE STRUCTURE: RED, GREEN, BLUE: BYTE;}
KILLMEM; {<-MUST CALL TO DESTROY MEMORY CREATED WHEN UNIT IS
LOADED!!!}
REPEAT UNTIL KEYPRESSED;
CLOSEGRAPH;
END;
END.